<%@page import="csci5828.tasks.RequestId"%>
<%
RequestId requestId = (RequestId)request.getAttribute("requestId");
java.util.Date date = new java.util.Date(); 
%>
<html>
  <head>
    <title>Comet Reviews</title>
    <script type="text/javascript" src="scripts/prototype.js"></script>
    <script type="text/javascript" src="scripts/util.js"></script>
    <script type="text/javascript">
window.onload = function() {
	xmlhttp = createXMLHttpRequest();
	xmlhttp.onreadystatechange = function() {
    	$("results").innerHTML = xmlhttp.readyState + ":" + xmlhttp.responseText;
	};
    xmlhttp.open("GET", "results?requestId=<%=requestId.getId()%>");
    xmlhttp.send(null);
};
    </script>
  </head>
  <body>
    <h1>Search Reviews</h1>
    <form action="/cometreviews/search">
      <input type="text" name="query" size="100"/>
      <input type="submit"/>
    </form>
    
    <h1>Results</h1>
    Time is now: <%=date%>
    RequestId is <%=requestId%>
    <div id="results">
    </div>
    <!--
    <iframe src="results?requestId=<%=requestId.getId()%>">
    </iframe>
      -->
  </body>
</html>